package com.skrabacz.kinetic.buisness.logic;

public class Node implements Point, Comparable<Node> {

	private double value;
	private Coordinates coordiantes;

	public Node() {
		this(0.0d);
	}

	public Node(double value) {
		this(value, new Coordinates2D(0, 0));
	}

	public Node(double value, Coordinates coordiante) {
		this.value = value;
		this.coordiantes = coordiante;
	}

	@Override
	public double getValue() {
		return value;
	}

	@Override
	public Coordinates getCoordinates() {
		return coordiantes;
	}

	@Override
	public int compareTo(Node node) {
		if (this.value > node.value) {
			return 1;
		} else if (this.value < node.value) {
			return -1;
		}
		return 0;
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof Node) {
			Node node = (Node) object;
			return this.value == node.value ? true : false;
		}
		return false;
	}

	@Override
	public int getCoordinateX() {
		return coordiantes.getX();
	}

	@Override
	public int getCoordinateY() {
		return coordiantes.getY();
	}

}
